package iphoneBackupScanner.parsing;

public enum DeviceID {

	
	iPhone("iPhone1,1"),
	iPhone3G("iPhone1,2"),
	iPhone3GS("iPhone2,1"),
	iPhone4("iPhone3.1"),
	iPod("iPod1,1"),
	iPod2G("iPod2,1"),
	iPod3G("iPod3,1"),
	iPod4G("iPod4,1"),
	iPad("iPad1,1"),
	iPad2Wifi("iPad2,1"),
	iPad2GSM("iPad2,2"),
	iPad2CDMA("iPad2,3");
	
	private final String identifier;

	DeviceID(final String identifier){
		this.identifier = identifier;
		
	}
	
	
	public static DeviceID parseDeviceID(final String str){
	
		DeviceID result = null;
		
		for(DeviceID id: values())
			if(str.equals(id.identifier))
				result = id;
				
		if(result == null)
			throw new IllegalArgumentException("Unknown Device");
		
		return result;
		
	}
}
